﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeatherStationSys.Common
{
    /// <summary>
    /// 日期工具类
    /// </summary>
    public class DateUtility
    {
        /// <summary>
        /// 日期转换为时间戳
        /// </summary>
        public static long ConvertToTimeStamp(DateTime dt)
        {
            TimeSpan ts = DateTime.UtcNow - dt;

            return Convert.ToInt64(ts.TotalMilliseconds);
        }
    }
}
